<%@ page language="java" import="java.util.*, java.text.*,java.sql.Timestamp,com.zjut.zs.util.tools.*,com.zjut.an.util.tools.*,com.zjut.an.util.system.*,
com.zjut.zs.user.manager.*, com.zjut.zs.user.dao.*,com.zjut.zs.zxlb.manager.*, com.zjut.zs.zxlb.dao.*,com.zjut.zs.school.manager.*, com.zjut.zs.school.dao.*,
com.zjut.zs.userstatus.manager.*, com.zjut.zs.userstatus.dao.*,com.zjut.an.config.manager.*, com.zjut.an.config.dao.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">  
<meta name="renderer" content="webkit"> 
<title>无标题文档</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/plugins/webupload/css/upload/upload.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/plugins/webupload/plugin/ueditor/third-party/webuploader/webuploader.css">	
<link rel="stylesheet" href="js/pop/my_popup.css">			
<script type="text/javascript" src="../plugins/assets/plugins/jquery-3.5.1.min.js"></script>
<script src="<%=request.getContextPath() %>/plugins/webupload/plugin/ueditor/third-party/webuploader/webuploader.min.js"></script>
<script type="text/javascript" src="js/pop/my_popup.js"></script>
<style type="text/css">
<!--
.select1 {
	border:1px solid #ccc;
	padding:8px;
	width:200px;
}
#zxtable td{
	height:30px;
    border:1px solid #ccc;
}
-->
</style>
</head>

<body>
<jsp:include page="zs_uservalidate.jsp" flush="true"/>
<%
if (session.getAttribute("zsUser") == null&&session.getAttribute("admin") == null&&session.getAttribute("user") == null) {
	out.print("<script>alert('由于长时间未操作，系统已经自动注销，请重新登陆');</script>");
	out.print("<script>top.window.location='main.jsp';</script>");
} else {
ZsSchoolManager zsManager = (ZsSchoolManager) SpringContextUtil.getBean("ZsSchoolManager");
ZsSchool school = new ZsSchool();
school = (ZsSchool)zsManager.getDataByInstance(1,1,null,null,school).getObjects().get(0);
//if(Status.ON.getStatus().equals(school.getScZxlbActive())){ //是否上传
//	out.print("<script>window.location='zs_zxlb.jsp';</script>");
//	out.close();
//	return;
//} else {
AnConfigManager anconfig = (AnConfigManager) SpringContextUtil.getBean("AnConfigManager");
ZsHTMLCreat html = (ZsHTMLCreat) SpringContextUtil.getBean("ZsHTMLCreat");
ZsZxlbManager xmanager = (ZsZxlbManager) SpringContextUtil.getBean("ZsZxlbManager");
ZsUserManager umanager = (ZsUserManager) SpringContextUtil.getBean("ZsUserManager");
ZsUserStatusManager smanager = (ZsUserStatusManager) SpringContextUtil.getBean("ZsUserStatusManager");
ZsZxlb zxlb = new ZsZxlb();
ZsUser user = null;
if(session.getAttribute("admin")!=null && request.getParameter("usId")!=null) {
	int usId = Integer.parseInt(request.getParameter("usId"));
	user = umanager.getData(usId);
} else if (session.getAttribute("zsUser")!=null) {
	user = (ZsUser)session.getAttribute("zsUser");	
}	
List list = new ArrayList();
if (user!=null) {
	zxlb.setZsUser(user);
	list = xmanager.getDataByInstance(1,100,"zxId","asc",zxlb).getObjects();
}

if(request.getParameter("zxId")!=null) {
	zxlb = xmanager.getData(Integer.parseInt(request.getParameter("zxId")));					
}	

 %>
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="index.jsp">首页</a></li>
    <li><a href="#">专项类别获奖</a></li>
    </ul>
    </div>
   
    <div class="formbody">
    
	    <div class="rightinfo">
		    
	    
	    
		    <table class="imgtable">
		    
		    <thead>
		    <tr>
		    <th>专项类别</th>
		    <th>奖项名称</th>
		    <th>奖项级别</th>
		    <th>获奖时间</th>
		    <th>组织单位</th>
		    <th>获奖等级</th>
		    <th>操作</th>
		    </tr>
		    </thead>
		    
		    <tbody>
		    <%
		    for (int i=0; i<list.size(); i++){
		    	ZsZxlb obj = (ZsZxlb)list.get(i);
		    	if(!"获奖情况".equals(obj.getZxType())){
		     %>
		    <tr>
		    <td><%=obj.getZxType() %></td>
		    <td><%=obj.getZxName() %></td>
		    <td><%=obj.getZxJb() %></td>
		    <td><%=obj.getZxDate() %></td>
		    <td><%=obj.getZxOrg() %></td>
		    <td><%=obj.getZxDj() %></td>
		    <td>
		    <%if(Status.APPSTATUS_NULL.getStatus().equals(smanager.getDataByUser(user).getAppStatus())){ %>
		    <a href="zs_zxlb_2.jsp?zxId=<%=obj.getZxId() %>" class="tablelink">编辑</a>　
		    <a href="#" onclick="javascript:deleteobj('<%=obj.getZxId() %>');">删除</a>
		    <%} %>
		    </td>
		    </tr>
		    <%} 
		    }%>
		    </tbody>
		    </table>


		    <br>
		     
		    
		    
		    

		    
	    </div>
    
    
    </div>
    					<%if(Status.APPSTATUS_NULL.getStatus().equals(smanager.getDataByUser(user).getAppStatus())){ %>
						<form id="ff" name="add" role="form" class="form-horizontal" action="" method="post">
								<table id="zxtable" class="imgtable" style="width:96%;margin:0 auto;">
							    <thead>
							    <tr>
							    <th>专项类别</th>
							    <th>奖项名称</th>
							    <th>奖项级别</th>
							    <th>获奖时间</th>
							    <th>组织单位</th>
							    <th>获奖等级</th>
							    </tr>
							    </thead>
							    <tbody>
							    <tr>
							    <td style="text-indent: 5px;">							    
							    <input id="zxType" name="zxType" type="text" class="dfinput" value="<%=html.getInputString(zxlb.getZxType()) %>" required style="width: 100px" readonly="true" onclick="oTwoPopup.show();"/>
							    </td>
							    <td style="text-indent: 5px;"><input id="zxName" name="zxName" type="text" class="dfinput" value="<%=html.getInputString(zxlb.getZxName()) %>" required style="width: 100px" onclick="oTwoPopup.show();"/></td>
							    <td style="text-indent: 5px;"><input id="zxJb" name="zxJb" type="text" class="dfinput" value="<%=html.getInputString(zxlb.getZxJb()) %>" required style="width: 100px"/></td>
							    <td style="text-indent: 5px;"><input id="zxDate" name="zxDate" type="text" class="dfinput" value="<%=html.getInputString(zxlb.getZxDate()) %>" required style="width: 100px"/></td>
							    <td style="text-indent: 5px;"><input id="zxOrg" name="zxOrg" type="text" class="dfinput" value="<%=html.getInputString(zxlb.getZxOrg()) %>" required style="width: 160px"/></td>
							    <td style="text-indent: 5px;">
							    <%=html.getSelectHTML("zxDj",zxlb.getZxDj()," class='select1' required ") %>
							    </td>
							    </tr>
							    </tbody>
							    </table>
							    <input name="zxFiles" type="text" id="zxFiles" value="<%=html.getInputString(zxlb.getZxFiles()) %>"  class="dfinput"  style="display:none;"/>  	
								<input id="zxId" name="zxId" type="text" class="dfinput" value="<%if(null==zxlb.getZxId()){out.print("");}else{out.print(zxlb.getZxId());}; %>" style="display:none;"/>
							    <input id="zsUser.usId" name="zsUser.usId" type="text" class="dfinput" value="<%=zxlb.getZsUser().getUsId()%>" style="display:none;"/>
								
								    <!--用来存放文件信息-->
								    
								    <div class="btns">	
										<button type="submit" class="btn btn-primary btn-sm" style="float:right;margin:10px;">确认保存</button>	
								    </div>
								
		    			</form>
		    			
					<div class="my-popup two-popup" id="twoPopup" style="clear:both;display:none">
					  <div class="popup-content">
					    <p class="msg">专项类别选择</p>
					    <div class="btn-box">
					    <table width="800" id="zxtable">
					    <td>专项类别</td><td>奖项名称</td><td>选择</td>
					    <%
					    List jlist = anconfig.getConfigsInfoByClass("专项类别明细");
					    for (int i=0;i<jlist.size(); i++) {
					    	AnConfig c = (AnConfig)jlist.get(i);
					    	%>
					    	<tr onclick="addzx('<%=c.getCoName()%>','<%=c.getCoValue()%>')" onmouseover="this.bgColor='#ccc'" onmouseout="this.bgColor=''"><td><%=c.getCoName() %></td><td><%=c.getCoValue() %></td><td><a href="#" onclick ="addzx('<%=c.getCoName()%>','<%=c.getCoValue()%>')"/>选择</a></td></tr>
					    	<%
					    }
					    %>
					    </table>
					      </div>
					  </div>
					</div>	
		<script src="js/laydate.dev.js" type="text/javascript"></script>
		<script type="text/javascript">
			//////////////////////////////////////////
			var oTwoPopup = new MyPopup('twoPopup', {
			  param: {
			    isfixed: false,	// 弹窗是否固定居中（默认true可以） 值：true、false
			    bgclose: false,	// 可否通过点击背景关闭弹窗 （默认true可以） 值：true、false
			    type: 'top',	// 弹窗出现的方式（默认none无动画） 值：none、opacity、top、right、bottom、left
			    time: 400,		// 弹窗出现动画的时长（默认200ms）
			    bgcolor: '#777',// 背景颜色（默认transparent）
			    opacity: 0.2 	// 背景透明度（默认0）
			  },
			  show: function () {
				console.log("这是显示弹窗前调用的函数");
			  },
			  close: function () {
				console.log("这是默认的关闭弹窗前调用的函数");
			  }
			});
			//////////////////////////////////////////
			laydate({
				elem: document.getElementById("zxDate")
			});
			
			function addzx(name,value) {
				$("#zxType").val(name);
				$("#zxName").val(value);
				oTwoPopup.close();
			}
		</script>
		    			<%} %>
<div style="margin:50px;width:500px;float:left;"><%out.print(anconfig.getSingleConfigInfoByName("专项类别填写需知")); %></div>
	    			
		    			
<script src="../plugins/assets/plugins/jquery-3.5.1.min.js" type="text/javascript"></script>  
<script src="../plugins/assets/plugins/jquery-validation-1.14.0/dist/jquery.validate.js" type="text/javascript"></script>
<script src="../plugins/assets/plugins/jquery-validation-1.14.0/dist/jquery.metadata.js" type="text/javascript"></script>
<script src="../plugins/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js" type="text/javascript" charset="UTF-8"></script>
<script src="../plugins/assets/plugins/bootstrap-datepicker/js/locales/bootstrap-datepicker.zh-CN.js" type="text/javascript"  charset="UTF-8"></script>
<script src="js/formvalidate.js" type="text/javascript"></script>
<script src="../admin/js/publicManager.js" type="text/javascript" charset="utf-8"></script> 

		<script type="text/javascript">
		
		var updateOneAction = '../zsZxlbSave.action?randnum='+Math.floor(Math.random()*1000000);
		var loactionurl = 'zs_zxlb_2.jsp';
			
		$(function(){
		    //jquery.validate
			$("#ff").validate({
				submitHandler: function() {
					//验证通过后 的js代码写在这里
					
					submitFormAdvance();
				}
			})
		})
		
		$('.imgtable tbody tr:odd').addClass('odd');
		

		function deleteobj(zxId) {
			if (confirm("是否确认"))  { 
				$.get("../zsZxlbDelete.action?randnum="+Math.floor(Math.random()*1000000)+"&zxId="+zxId, function(data){
					if(data.flag=="success"){
						alert("删除成功！");
						window.location = loactionurl;
					}else{
						alert("删除失败！");
					}
				}); 
			}
		}
		</script>
<%//} 
}%>		
</body>

</html>
